<?php namespace Home\Model;

use Framework\Model\Model;

class User extends Model{
	protected $table ='user';

	public function reg()
	{
		//写验证。。。。。
		if(empty($_POST['username']))
		{
			$this->error = '帐号不能为空';
			return false;
		}
		
		$sql = 'INSERT INTO user (username,password) VALUE(?,?)';
		$params['username']=$_POST['username'];
		$params['password']=$_POST['password'];
		return $this->execute($sql,$params);
	}
}